package alidns

import (
	"net/http"

	"gitee.com/bitwormhole/cloud-aliyun-api/aliyun/openapi"
)

// DescribeDomainRecords 获取域名信息
type DescribeDomainRecords struct {
	Endpoint string

	Lang         string
	DomainName   string // 要查询的域名 (required)
	PageNumber   int64
	PageSize     int64
	KeyWord      string
	RRKeyWord    string
	TypeKeyWord  string
	ValueKeyWord string
	OrderBy      string
	Direction    string
	SearchMode   string
	GroupID      int64
	Type         string
	Line         string
	Status       string
}

// PrepareRequest ...
func (inst *DescribeDomainRecords) PrepareRequest() *openapi.Request {

	req := &openapi.Request{
		Task: inst,
	}

	action := "DescribeDomainRecords"
	version := myAPIDefaultVersion

	req.Endpoint = inst.Endpoint
	req.HTTPMethod = http.MethodGet
	req.PathParameters = nil
	req.QueryParameters = nil
	req.Style = openapi.StyleRPC
	req.Action = action
	req.APIVersion = version

	setter := &paramSetter{request: req}

	setter.setParamString("Action", action)
	setter.setParamString("Lang", inst.Lang)
	setter.setParamString("DomainName", inst.DomainName)

	setter.setParamString("KeyWord", inst.KeyWord)
	setter.setParamString("RRKeyWord", inst.RRKeyWord)
	setter.setParamString("TypeKeyWord", inst.TypeKeyWord)
	setter.setParamString("ValueKeyWord", inst.ValueKeyWord)
	setter.setParamString("OrderBy", inst.OrderBy)
	setter.setParamString("Direction", inst.Direction)
	setter.setParamString("SearchMode", inst.SearchMode)
	setter.setParamString("Type", inst.Type)
	setter.setParamString("Line", inst.Line)
	setter.setParamString("Status", inst.Status)

	setter.setParamInt64("GroupId", inst.GroupID)
	setter.setParamInt64("PageNumber", inst.PageNumber)
	setter.setParamInt64("PageSize", inst.PageSize)

	return req
}

// HandleResponse ...
func (inst *DescribeDomainRecords) HandleResponse(req *openapi.Request) error {

	return nil
}
